﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using VideoNetApplication.Common;
using VideoNetApplication.Common.Helper;
using VideoNetApplication.Common.Service;

namespace VideoNetApplication
{
    public partial class ViewRecruitListHtml : BasePage
    {
        public string SchoolImg = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack)
            InitRecruitList();

        }

        private  void InitRecruitList()
        {
            var recruitStudentService = new RecruitStudentService();
            int outcount = 0;
            List<V_RecruitStudent> vRecruitStudents = recruitStudentService.GetRecruitList(SchoolId, pager.StartRecordIndex, pager.PageSize, out outcount);
            pager.RecordCount = outcount;
            repRec.DataSource = vRecruitStudents;
            repRec.DataBind();

        }

        protected void pager_PageChanged(object sender, EventArgs e)
        {
            InitRecruitList();
        }

        /// <summary>
        /// 学校简介
        /// </summary>
        public string ShowSchoolInfo()
        {
            var s = new SchoolConfigService();
            V_school school = s.QuerySchoolById(SchoolId);
            if (school != null)
            {
                SchoolImg = school.VS_schoolImg;
                return school.VS_Desc;
            }
            return "";
        }
    }
}
